home *** CD-ROM | disk | FTP | other *** search
- Path: news.tau.ac.il!usenet
- From: Avi Lev <avil@sapiens.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Copy with c
- Date: Sun, 17 Mar 1996 12:57:01 +0200
- Organization: Sapiens Technologies
- Message-ID: <314BEFFD.1B98@sapiens.com>
- References: <660.6643T24T753@enterprise.net>
- NNTP-Posting-Host: honda.sapiens.co.il
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Mark Smith wrote:
- >
- > This may seem like a simple thing. But i am new to using C.
- >
- > How do i get a program to copy a file, that will be in the same
- > directory as the program, to a user defined place. (sort of like
- > installer programs) ?
-
- well, there're 2 ways to handle it, the simplest way would be to call the system() function.
- this function is for calling CLI system commands for withing a C program, all you have to do is
- give it the string of the command and it does the rest, also make sure to check any error code
- it returna, so there'll be no surprises. about the 2nd way, well you could use fopen() to open
- the input/output files and then use fread() and fwrite() to do the transfer, but you'll be
- inventing the wheel, use the 1st way.
-
- Avi Lev.
-